const path = require('path');
const webpack = require('webpack');
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')

const entry = {
	bundle: [
		'./platforms/browser'		
	],
	vendor: [
		'react',
		'react-dom',
		'react-router',
	]
};

const output = {
	path: path.resolve(__dirname, '../dist'), //生成目录
	publicPath: "/", //生成的公共目录
	filename: '[name].js', //文件名,不加chunkhash,以方便调试时使用，生产环境下可以设置为 [name].bundle.[hash:8].js
	chunkFilename: 'chunk.[name].js', //块文件索引 chunk.[name].[hash:8].js
	sourceMapFilename: "[name].map", //映射名
}; 

const config = {
	context: path.resolve(__dirname, '..'),
	entry: {},
	output: output,
	resolve: {
		extensions: ['.js', '.jsx', 'json', '.css']
	},
	plugins: [
		new webpack.optimize.OccurrenceOrderPlugin(),
		new FriendlyErrorsPlugin()
	]
};

module.exports = config;